class InsertData < ActiveRecord::Migration
  def self.up
    User.create( :os_id => '123456',
                 :name => 'Waigo',
                 :level => 0,
                 :ep => 0,
                 :money => 1000)
     BaseMaterial.create(:name => '土豆',
                         :description => '土豆',
                         :price => '1')
     BaseMaterial.create(:name => '青椒',
                         :description => '青椒',
                         :price => '1')                  
    
     BaseSpice.create(:name => '油',
                      :description => '油',
                      :price => '1')
     BaseSpice.create(:name => '盐',
                      :description => '盐',
                      :price => '1')     
    
  end

  def self.down
    BaseSpice.find_by_name(:name=>'盐').destroy!
    BaseSpice.find_by_name(:name=>'油').destroy!
    BaseMaterial.find_by_name(:name=>'青椒').destroy!
    BaseMaterial.find_by_name(:name=>'土豆').destroy!
    User.find_by_os_id_and_name('123456', 'Waigo').destroy!
  end
end
